<template>
    <div >
        {{message}}
        <slot name="slot1"></slot>
        <slot name="scope_slot" :childData2="childData2"></slot>
    </div>
</template>

<script>
    export default {
        name: "Child_Component",
        props: ['message'],
        data(){
            return {
                childData:'子组件数据',
                childData2:'1234'
            }
        },
        methods: {
            changeMessage() {
                setTimeout(() =>
                    this.$emit('receiveMessage','孩子收到了爸爸的消息，然后发送消息给了爸爸...'), 1000)
                console.log('孩子发送了消息...')
            }
        },
        created() {
            console.log(this.$parent.children_message)
            setTimeout(() => this.changeMessage(), 3000)
        }
    }
</script>

<style scoped>

</style>
